package com.atguigu.srb.core.controller.admin;


import com.atguigu.srb.core.pojo.entity.UserLoginRecord;
import com.atguigu.srb.core.service.UserLoginRecordService;
import com.atguigu.srb.result.R;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * <p>
 * 用户登录记录表 前端控制器
 * </p>
 *
 * @author fun
 * @since 2021-10-29
 */
@Api(tags = "会员登录日志接口")
@RestController
@RequestMapping("/admin/core/userLoginRecord")
public class AdminUserLoginRecordController {
    @Autowired
    private UserLoginRecordService userLoginRecordService;

    @ApiOperation("登录日志")
    @GetMapping("/listTop50/{id}")
    public R listTop50(@PathVariable("id") Long id) {
        List<UserLoginRecord> loginRecords = userLoginRecordService.listTop50(id);
        return R.ok().data("list",loginRecords);
    }

}

